import { httpMI } from '@/utils/requestMI'


/**
 * @description 进行登录
 * @param phone 手机号
 * @param password 密码
 */
export const reqLogin = (phone: string, password: string) => {
    return httpMI('/api/user/passport/login', 'POST',{
      phone,password
    })
}
  

  /**
 * @description 获取验证码
 * @param phone 手机号
 */
export const reqSendCode = (phone: string) => {
  return httpMI(`/api/user/passport/sendCode/${phone}`, 'GET')
}


  /**
 * @description 注册
 * @param phone 手机号
 * @param password 密码
 * @param code 验证码
 */
  export const reqRegister = (phone: string,password:string,code:string) => {
    return httpMI('/api/user/passport/register', 'POST',{
      phone,password,code
    })
  }

 /**
 * @description 退出登录
 */
 export const reqLogout = () => {
  return httpMI('/api/user/passport/logout', 'GET')
}

/**
 * @description 获取用户信息
 */
export const reqUserInfo = () => {
  return httpMI('/api/user/passport/auth/getUserInfo','GET')
}

